<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div v-for="(a,b) in list">{{b}}{{a}}</div>
        <div v-for="item in  arr" v-bind:id="'tr_'+item.id" :class="'my_'+item.id">
            {{item.id}}
        </div>
        <button @click="add">新增一个数据</button>
        <div  v-for="item in n"  v-if="item>4">
           <span >{{item}}</span> 
        </div>
        <hr/>
        <div v-for="item in nList"> {{item}}</div>
    </div>
    
</body>
<script>
      new  Vue({
        el:"#app",
        data:{
            n:99,
            list:[1,2,"b",4],
            arr:[{id:1},{id:2},{id:3}]
        },
        computed:{//计算属性
            nList(){
                let  arr = [];
                for(let i=5;i<=this.n;i++){
                    arr.push(i);
                }
                return  arr;
            }

        },
        methods:{
            add(){
                //this.list =   this.list.push("a");
                this.list.push("a");
               // this.n = this.n+"1";
            }
          
        }

      })

</script>
</html>